#!/bin/bash
fileDir="/Users/long3/workspace/usefullc/electron-comment/electron/build/icons/origin.png"
outFileName="/Users/long3/workspace/usefullc/electron-comment/electron/build/icons"

tmpFileName=__tmp.iconset
mkdir $tmpFileName
sips -z 512 512 $fileDir --out $tmpFileName/icon_512x512.png
iconutil -c icns $tmpFileName -o $outFileName/icon.icns
rm -rf $tmpFileName

sips -z 512 512 $fileDir --out $outFileName/512x512.png
sips -z 256 256 $fileDir --out $outFileName/256x256.png
sips -z 32 32 $fileDir --out $outFileName/icon.png
#echo /usr/local/bin/magick convert $fileDir -define icon:auto-resize=256,48,32,16 $outFileName/icon.ico
#/usr/local/bin/magick convert $fileDir -define icon:auto-resize=256,48,32,16 $outFileName/icon.ico
#convert input.png -resize 256x256 -background none -flatten -colors 256 output.ico
magick convert $fileDir $outFileName/image.png

convert $outFileName/image.png -resize 256x256 -background none -flatten -colors 256 $outFileName/icon.ico
